<?php
class DB_Connect {
    // constructor
    function __construct() {
    }
    
    // destructor
    function __destruct() {
    }
 
    // Connecting to database
    public function connectTicker() {
    	include_once 'config/config.php';
    	$db = @new mysqli(DB_HOST1, DB_USER1, DB_PASSWORD1, DB_NAME1);
    	if (mysqli_connect_errno()) {
    		die ('Konnte keine Verbindung zur Datenbank aufbauen: '.mysqli_connect_error().'('.mysqli_connect_errno().')');
    	}
        return $db;
    }
    
    public function connectWordpress() {
    	include_once 'config/config.php';
    	$db = @new mysqli(DB_HOST2, DB_USER2, DB_PASSWORD2, DB_NAME2);
    	if (mysqli_connect_errno()) {
    		die ('Konnte keine Verbindung zur Datenbank aufbauen: '.mysqli_connect_error().'('.mysqli_connect_errno().')');
    	}
    	return $db;
    }
 
    // Closing database connection
    public function close() {
        mysql_close();
    }
}
?>